#include <stdlib.h>
#include <cgicc/Cgicc.h>
#include "../ConnectMsg.h"
#include "CgiWrapper.h"

using namespace cgicc;;

int main()
{
    try
    {
	Cgicc formData;

	form_iterator submitType = formData.getElement("submitType");
	form_iterator usr = formData.getElement("usr");

	CGIWrapper cgi;
	cgi.HTMLHeader();
	cgi.BeginHtml();
	cgi.BeginHead((**usr) + "'s Home");
	cgi.EndHead();
	cgi.BeginBody();
	switch ((ClientMsg)atoi((**submitType).c_str()))
	{
	case LOGIN:
	    cgi.HtmlText("Login Success");
	    break;
	case REGISTER:
	    cgi.HtmlText("Register Success");
	    break;
	}
	cgi.EndBody();
	cgi.EndHtml();
    }
    catch(...)
    {
    }
}
